package com.dream.mapper;

import com.dream.common.utils.payutils.bean.AliRedPackagePickerInfo;
import com.dream.dto.response.GroupMemberRedPackPicker;
import com.dream.entity.OverViewDataBean;
import com.dream.entity.PickUserInfoBean;
import com.dream.entity.PickerOverViewBean;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;

public interface RedPackagePickMapper extends Mapper<PickUserInfoBean>, MySqlMapper<PickUserInfoBean> {
    List<GroupMemberRedPackPicker> selectPickUserGroupByUserID(@Param("bijiAccount") String bijiAccount);

    GroupMemberRedPackPicker selectPickUserByUserID(String bijiAccount, String memberId);

    /**
     * 插入抢包人红包数据到数据库
     */
    void insertRedPackagePick(List<AliRedPackagePickerInfo> pickerInfoList);

    /**
     * 通过指定的器人账号获取所有的抢包人信息
     */
    List<PickerOverViewBean> queryPickerDataList(String robotUser, long startTime, long endTime);

    /**
     * 查询指定人抢包数据
     *
     * @param robotUser
     * @param userId
     * @return
     */
    PickerOverViewBean queryPickerDataByUserId(String robotUser, String userId);

    /**
     * 通过指定的机器人账号获取所有的发包信息
     */
    int deleteRedPackagePickInfo(String robotUser, long startTime, long endTime);

    /**
     * 通过指定的机器人账号获取所有的发包信息
     */
    int deleteRedPackagePickInfoByUserId(String robotUser, String userId, long startTime, long endTime);

    /**
     * 通过用户id获取抢包详情
     */
    List<OverViewDataBean> queryPickDetailByUserId(String robotUser, long startTime, long endTime, long userId);

    /**
     * 获取抢包统计
     */
    List<OverViewDataBean> getPickOverViewData(String robotUser, long startTime, long endTime);
}